<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2017/5/29
 * Time: 11:21
 */

namespace Home\Model\User;


use Think\Model;

class UserModel extends Model
{
    public function saveTime($time, $user_id)
    {
        $this->where(array('id' => $user_id))->save(array('last_time' => $time));
    }

    public function incDayNum($user_id)
    {
        $this->where(array('id' => $user_id))->setInc('day_num');
    }

    public function findDayNum($user_id)
    {
        return $this->where(array('id' => $user_id))->find();
    }

    public function resetDayNum($user_id)
    {
        $this->where(array('id' => $user_id))->save(array('day_num' => 1));
    }
}